package com.ruoyi.system.enservice.impl;

import com.ruoyi.system.domain.GaPropaganda;
import com.ruoyi.system.dto.output.PropagandaInformationOutput;
import com.ruoyi.system.enservice.IPropagandaEnService;
import com.ruoyi.system.service.IGaPropagandaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class PropagandaEnServiceImpl implements IPropagandaEnService {

    @Autowired
    private IGaPropagandaService gaPropagandaService;

    public PropagandaInformationOutput getInformation(Long propagandaId){
        GaPropaganda gaPropaganda = new GaPropaganda();
        gaPropaganda.setId(propagandaId);

        gaPropaganda = gaPropagandaService.selectGaPropagandaList(gaPropaganda).get(0);

        return new PropagandaInformationOutput()
                .setPropagandaName(gaPropaganda.getTitle())
                .setPropagandaContent(gaPropaganda.getContent())
                .setCreateTime(gaPropaganda.getCreateTime())
                .setCreateUser(gaPropaganda.getCreateUser());
    }
}
